<?php
/*
Template Name: Receitas Doces
*/
?>

<?php get_header(); ?>
<body <?php body_class("bg_3"); ?>>
<div id="container">
	<?php include("wp-content/themes/coalhadas/menutopo.php"); ?>
<style type="text/css" media="screen">
		.slides_container {
			width:215px;
			height:400px;
			display:none;
			overflow:hidden;
		}
		.slides_container div {
			width:215px;
		}
		.pagination {
			list-style:none;
			margin:0;
			padding:0;
		}
		.pagination .current a {
			color:red;
		}
		.prev {
			float: left;
			margin-top: -220px;
			margin-left: -40px;
			position: absolute;
			z-index: 9999;
		}
		.next {
			margin-top: -220px;
			margin-left: 910px;
			position: absolute;
			z-index: 9999;
		}
		img{
			border: 0;
		}
		#slides2 .next , #slides3 .next , #slides4 .next {
			visibility:hidden;
			z-index: -1;
		}
		#slides2 .prev , #slides3 .prev , #slides4 .prev {
			visibility:hidden;
			z-index: -1;
		}
	</style>
    <script>
		var elemento1 = null, elemento2 = null, elemento3 = null;
	</script>
	<script src="<?php echo get_template_directory_uri(); ?>/library/js/slides.min.jquery.js"> </script>
	<script>
		jQuery(function($){
			$('#slides').slides({
				preload: false,
				generateNextPrev: true,
				generatePagination: false
			});
			$('#slides2').slides({
				start: 2,
				preload: false,
				generateNextPrev: true,
				generatePagination: false
			});
			$('#slides3').slides({
				start: 3,
				preload: false,
				generateNextPrev: true,
				generatePagination: false
			});
			$('#slides4').slides({
				start: 4,
				preload: false,
				generateNextPrev: true,
				generatePagination: false
			});
			$('#slides .next').click(function() {
				$('#slides2 .next').click();
				$('#slides3 .next').click();
				$('#slides4 .next').click();
			});
			$('#slides .prev').click(function() {
				$('#slides2 .prev').click();
				$('#slides3 .prev').click();
				$('#slides4 .prev').click();
			});
		});
	</script>
    <div id="content">
   	    <div id="wrapper_capas">
            <div class="capa_produto first_capa">
            	<div id="slides">
                    <div class="slides_container">
                    	<?php
							global $post;
							$myposts = get_posts('numberposts=-1&category=3');
							foreach($myposts as $post) :
							setup_postdata($post);
						?>
                        <div>
                        	<a href="<?php the_permalink();?>">
                            <div class="titulo_capa">
                                <div class="titulo_capa_meio">
                                    <div class="titulo_capa_interior">
									<?php the_title(); ?>
									</div>
                                </div>
			                </div><!--titulo_capa-->
                            <?php
								$id = get_post_thumbnail_id($post->ID);
								if(stripos($id,'ngg-') !== false && class_exists('nggdb')){
									$nggImage = nggdb::find_image(str_replace('ngg-','',$id));
									$urlThumb = array(
										$nggImage->imageURL,
										$nggImage->width,
										$nggImage->height
									);
								}else{
									$urlThumb = wp_get_attachment_image_src($id,'full', true);
								}
								echo '<img src="'.$urlThumb[0].'" width="215px" />';
							?>
                            </a>
                        </div>
						<?php endforeach; ?>  
                    </div>
                </div>
            </div><!--capa_produto-->
            <div class="capa_produto">
            	<div id="slides2">
                    <div class="slides_container">
                        <?php
							global $post;
							$myposts = get_posts('numberposts=-1&category=3');
							foreach($myposts as $post) :
							setup_postdata($post);
						?>
                        <div>
                        	<a href="<?php the_permalink();?>">
                            <div class="titulo_capa">
                                <div class="titulo_capa_meio">
                                    <div class="titulo_capa_interior">
									<?php the_title(); ?>
									</div>
                                </div>
			                </div><!--titulo_capa-->
                            <?php
								$id = get_post_thumbnail_id($post->ID);
								if(stripos($id,'ngg-') !== false && class_exists('nggdb')){
									$nggImage = nggdb::find_image(str_replace('ngg-','',$id));
									$urlThumb = array(
										$nggImage->imageURL,
										$nggImage->width,
										$nggImage->height
									);
								}else{
									$urlThumb = wp_get_attachment_image_src($id,'full', true);
								}
								echo '<img src="'.$urlThumb[0].'" width="215px" />';
							?>
                            </a>
                        </div>
						<?php endforeach; ?>
                    </div>
                </div>
            </div><!--capa_produto-->
            <div class="capa_produto">
            	<div id="slides3">
                    <div class="slides_container">
                        <?php
							global $post;
							$myposts = get_posts('numberposts=-1&category=3');
							foreach($myposts as $post) :
							setup_postdata($post);
						?>
                        <div>
                        	<a href="<?php the_permalink();?>">
                            <div class="titulo_capa">
                                <div class="titulo_capa_meio">
                                    <div class="titulo_capa_interior">
									<?php the_title(); ?>
									</div>
                                </div>
			                </div><!--titulo_capa-->
                            <?php
								$id = get_post_thumbnail_id($post->ID);
								if(stripos($id,'ngg-') !== false && class_exists('nggdb')){
									$nggImage = nggdb::find_image(str_replace('ngg-','',$id));
									$urlThumb = array(
										$nggImage->imageURL,
										$nggImage->width,
										$nggImage->height
									);
								}else{
									$urlThumb = wp_get_attachment_image_src($id,'full', true);
								}
								echo '<img src="'.$urlThumb[0].'" width="215px" />';
							?>
                            </a>
                        </div>
						<?php endforeach; ?> 
                    </div>
                </div>
            </div><!--capa_produto-->
            <div class="capa_produto last_capa">
            	<div id="slides4">
                    <div class="slides_container">
                        <?php
							global $post;
							$myposts = get_posts('numberposts=-1&category=3');
							foreach($myposts as $post) :
							setup_postdata($post);
						?>
                        <div>
                        	<a href="<?php the_permalink();?>">
                            <div class="titulo_capa">
                                <div class="titulo_capa_meio">
                                    <div class="titulo_capa_interior">
									<?php the_title(); ?>
									</div>
                                </div>
			                </div><!--titulo_capa-->
                            <?php
								$id = get_post_thumbnail_id($post->ID);
								if(stripos($id,'ngg-') !== false && class_exists('nggdb')){
									$nggImage = nggdb::find_image(str_replace('ngg-','',$id));
									$urlThumb = array(
										$nggImage->imageURL,
										$nggImage->width,
										$nggImage->height
									);
								}else{
									$urlThumb = wp_get_attachment_image_src($id,'full', true);
								}
								echo '<img src="'.$urlThumb[0].'" width="215px" />';
							?>
                            </a>
                        </div>
						<?php endforeach; ?> 
                    </div>
                </div>
            </div><!--capa_produto-->
    	</div><!--wrapper-->
    </div><!--content-->
    
<?php get_footer(); ?>